Dynomotion

Group: DynoMotion Message: 14369 From: lmp582002 Date: 1/25/2017
Subject: Append Text File

Howdy,


I am trying to put together an error log for my router. I see the fprintf example where I can write to a file, but the "wt" command seems to overwrite the file. I am wanting it to append to the file rather than over writing it. I thought the normal way to do this was to use "a" for append instead of "wt" 


f=fopen("c:\\Temp\\KFlopData.txt","wt");

fprintf(s,"%f,%f,%f\n",a,b,c);

fclose(f);


Does anyone know how to modify this code so that it will just add on to the end of the text file each time it is executed?


Thanks,


Scott


Group: DynoMotion Message: 14375 From: Tom Kerekes Date: 1/26/2017
Subject: Re: Append Text File

Hi Scott,

No sorry KFLOP doesn't currently support opening files in append mode.

Regards
TK


On 1/25/2017 7:32 PM, lmp582002@... [DynoMotion] wrote:
 

Howdy,


I am trying to put together an error log for my router. I see the fprintf example where I can write to a file, but the "wt" command seems to overwrite the file. I am wanting it to append to the file rather than over writing it. I thought the normal way to do this was to use "a" for append instead of "wt" 


f=fopen("c:\\Temp\\KFlopData.txt","wt");

fprintf(s,"%f,%f,%f\n",a,b,c);

fclose(f);


Does anyone know how to modify this code so that it will just add on to the end of the text file each time it is executed?


Thanks,


Scott